<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Worker extends MY_Controller {
	
	public function __construct(){
		parent::__construct();
	}
	
	public function index(){
		$this->load->view('workerLogin');
	}
	
	public function login(){
		$username = $this->input->post('name');
		$password = $this->input->post('password');
		$this->load->model('worker_model');
		$re = $this->worker_model->login($username,$password);
		if(empty($re)){
			echo "账户密码错误！！！";
		}else{
			$this->load->model('reservation_model');
			$data['list'] = $this->reservation_model->reservationListByWorker($re[0]['classid']);
			$this->load->view('worker',$data);
		}
		
	}
	

	
}
?>